<?php
?>
<img class="star-cloud" id="star-cloud-page-01" src="<?php bloginfo('template_url'); ?>/images/site/star-cloud.png" alt=""/>
<div id="jeslee-model-specs">
</div>
<div class="collection-page">
<?php
   $picturelist = nggdb::get_gallery($GLOBALS['collectionId'], 'sortorder', 'ASC');
   if ($picturelist) {
      $galSize = count($picturelist);
      ?>
      <div id='jeslee-model-gallery'>
           <div class="model-thumbs">
              <div class="model-thumb-list">
              <div class="collection-description">
               <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                  <h3><?= the_title(); ?></h3>
                  <?php the_content(); ?>
               <?php endwhile; ?>
              </div>
              <ul>
      <?php
         $imageCount = 0;
         $width=200;
         $height=400;
         $widthLarge=400;
         $heightLarge=800;
      ?>
      <?php
         foreach ($picturelist as $picture) {
            $imageCount++;
         // check for cached picture
            // if width and height are change also change the css style '#jeslee-model-gallery li' in model-slideshow.css
         if ( ($ngg_options['imgCacheSinglePic']) && ($post->post_status == 'publish') )
             $picture->thumbnailURL = $picture->cached_singlepic_file($width, $height, $mode );

         // if we didn't use a cached image then we take the on-the-fly mode
         if (!$picture->thumbnailURL)
             $picture->thumbnailURL = home_url() . '/' . 'index.php?callback=image&amp;pid=' . $picture->pid . '&amp;width=' . $width . '&amp;height=' . $height . '&amp;mode=' . $mode;
         ?>
            <li class="darkClass">
               <div class="meta-info">
                  <div class="modelName">Model <?=$picture->alttext?></div>
                  <div class="specs"><?=$picture->description?></div>
               </div>
               <a class="large-model-impression" id="model-impression-<?=$imageCount?>" href="<?=home_url() . '/' . 'index.php?callback=image&amp;pid=' . $picture->pid . '&amp;width=' . $widthLarge . '&amp;height=' . $heightLarge . '&amp;mode=' . $mode?>">
                  <img src='<?=$picture->thumbnailURL?>' alt='<?=$picture->alttext?>' class="image<?=$imageCount?>"/>
               </a>
            </li>
         <?php

      }
      ?>
              </ul>
              <div class="collection-description">
                 <h3><?= the_title(); ?></h3>
              </div>

           </div>
        </div>
    </div>

    <div id="descriptions">

    </div>
      <?php
   }
   else
   {
      ?>
      <div class='error'>No gallery found with id '<?=$GLOBALS['collectionId']?>'</div>
      <?php

   }?>

</div>
